// src/store/index.ts
import { createStore } from 'vuex' //引入变量管理
import Modules from "./Modules" //引入模块
import type { TypeRootState } from "./type"
import persistedState from "vuex-persistedstate"; //引入类型

const store = createStore<TypeRootState>({
    modules:Modules,
    plugins: [persistedState({
        // 传入参数
        storage: {
            getItem: (key) => uni.getStorageSync(key),
            setItem: (key, value) => uni.setStorageSync(key, value),
            removeItem: (key) => uni.removeStorageSync(key)
        }
    })]
})//创建变量管理器

export default store //返回